import { IsString, IsNumber, IsBoolean, IsDate, IsOptional, IsEnum } from 'class-validator';
import { ApiProperty, OmitType, IntersectionType } from '@nestjs/swagger';
import { PagingDto } from 'src/common/dto/index';

export class CreateSchoolDto {
  @ApiProperty({ required: true, description: '学校编码' })
  @IsString()
  @IsOptional()
  schoolCode: string;

  @ApiProperty({ required: false, description: '学校Logo' })
  @IsOptional()
  @IsString()
  logo?: string;

  @ApiProperty({ required: true, description: '联系人' })
  @IsString()
  @IsOptional()
  contactName: string;

  @ApiProperty({ required: true, description: '联系电话' })
  @IsOptional()
  contactPhone: string;

  @ApiProperty({ required: true, description: '学校名称' })
  @IsString()
  @IsOptional()
  schoolName: string;

  @ApiProperty({ required: false, description: '学校名称' })
  @IsOptional()
  remark: string;
}

export class UpdateSchoolDto extends CreateSchoolDto {
  @ApiProperty({ required: false, description: '学校ID' })
  @IsOptional()
  @IsNumber()
  schoolId?: number;
}

export class ListSchoolDto {
  @ApiProperty({ required: false, description: '学校ID' })
  @IsOptional()
  @IsNumber()
  schoolId?: number;

  @ApiProperty({ required: false, description: '创建时间' })
  @IsOptional()
  @IsString()
  createTime?: string;

  @ApiProperty({ required: false, description: '学校编码' })
  @IsString()
  @IsOptional()
  schoolCode?: string;

  @ApiProperty({ required: false, description: '联系人' })
  @IsString()
  @IsOptional()
  contactName: string;

  @ApiProperty({ required: false, description: '联系电话' })
  @IsString()
  @IsOptional()
  contactPhone: string;

  @ApiProperty({ required: true, description: '学校名称' })
  @IsString()
  @IsOptional()
  schoolName: string;
}

export class QuerySchoolDto extends IntersectionType(ListSchoolDto, PagingDto) {}
